<template>
  <el-form-item prop="name" :rules="nameRequiredRule">
    <span slot="label">
      {{ i18nt("designer.setting.uniqueName") }}
    </span>
    <el-input type="text" :value="optionModel.name" disabled readonly />
  </el-form-item>
</template>

<script>
import i18n from "Yan/utils/i18n";

export default {
  name: "name-editor",
  mixins: [i18n],
  props: {
    designer: Object,
    optionModel: Object,
  },
  inject: ["serverFieldList", "getDesignerConfig"],
  data() {
    return {
      nameRequiredRule: [{ required: true, message: "name required" }],
    };
  },
  methods: {
    updateWidgetName(newName) {
      if (!newName) this.optionModel.name = this.designer.selectedId;
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
